草庐IT

redis 大Key问题

全部标签

c# - 使用 linq-to-entities 将字符串转换为日期时间的大问题

如何使用linqtoentities将字符串转换为日期时间....我有下面的查询,其中visit_date列数据类型是字符串...varmemberl=fromvinabc.visitsjoinminabc.membersonv.member_Idequalsm.member_IdwhereConvert.ToDateTime(v.visit_Date)>=startdate&&Convert.ToDateTime(v.visit_Date)很遗憾,我无法更改架构...我遇到了错误:linqtoentitesdoesnotrecogniseConvert.ToDatetimemetho

c# - 使用 itextsharp 在 pdf 文件中画线的问题

我正在使用itextsharp在asp.netc#中生成一个pdf文件。我无法绘制水平线/垂直线/虚线。我尝试使用以下代码绘制一条线,我没有收到任何错误,但该线也没有显示在pdf文件中PdfContentBytecb=wri.DirectContent;cb.SetLineWidth(2.0f);//Makeabitthickerthan1.0defaultcb.MoveTo(20,pdfDocument.Top-40f);cb.LineTo(400,pdfDocument.Top-40f);cb.Stroke();代码有什么问题,是不是因为xy坐标的位置?我曾使用粗略的点来了解pdf

c# - 我得到 "missing a using directive or assembly reference"并且不知道出了什么问题

我正在尝试允许用户将数据输入到将添加到web.config文件的文本框中。我已将相关行添加到web.config文件中,但是当我创建此类时,一切都出错了。每当我尝试运行我的应用程序时,我总是收到“您是否缺少using指令或程序集引用错误”。我看过其他时候有人问过这个问题,但似乎无法弄清楚我哪里出错了。问题是我对VisualStudio非常陌生,对可能的答案一无所知。下面是产生错误的类文件。我希望我已经包括了你需要帮助我的一切。谢谢。usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Configuration;nam

c# - Asp.net MCV4 框架问题

我使用VS2012和MVC4制作了一个网站,它在我的本地主机上工作,但是当我发布并放置我的主机时它不起作用。IIS配置相同。但它给了我这个错误行:这是错误;ConfigurationErrorDescription:Anerroroccurredduringtheprocessingofaconfigurationfilerequiredtoservicethisrequest.Pleasereviewthespecificerrordetailsbelowandmodifyyourconfigurationfileappropriately.ParserErrorMessage:Th

c# - 导出到 excel 的 RadGrid telerik 问题

我在我的MasterTableView中添加了以下行:但是当我点击它时,会出现正在加载的div,然后刷新网格上的数据,没有其他任何事情发生。没有“保存文件”窗口。我错过了什么吗? 最佳答案 在Grid前添加如下代码:functiononRequestStart(sender,args){if(args.get_eventTarget().indexOf("ExportToExcelButton")>=0||args.get_eventTarget().indexOf("ExportToWordButton")>=0||args.ge

c#控制台,Console.Clear问题

我正在用C#编写控制台程序。有没有一种方法可以使用Console.Clear()来仅清除控制台屏幕上的某些内容?这是我的问题:我有一个Logo(我使用Console.WriteLine()将它放在屏幕上)和一个二维数组,我想保持不变并清除其下方的所有内容。 最佳答案 您可以使用自定义方法来清除部分屏幕...staticvoidClear(intx,inty,intwidth,intheight){intcurTop=Console.CursorTop;intcurLeft=Console.CursorLeft;for(;height

c# - 生成随机唯一数字的性能问题

我有一种情况需要创建数以万计的唯一数字。但是这些数字必须是9位数字并且不能包含任何0。我目前的方法是生成9位数字(1-9)并将它们连接在一起,如果该数字不在列表中,则将其添加到其中。例如publicvoidgenerateIdentifiers(intquantity){uniqueIdentifiers=newList(quantity);while(this.uniqueIdentifiers.Count然而,在大约400,000时,这个过程确实变慢了,因为越来越多的生成数字是重复的。我正在寻找一种更有效的方法来执行此过程,我们将不胜感激。编辑:-我正在生成这些-http://ww

C#:当两个命名空间相似时尝试解析类时出现问题

我遇到了无法引用不同命名空间中的类的问题。我有2个类(class):namespaceFoo{publicclassClass1{...}}namespaceMy.App.Foo{publicclassClass2{publicvoidSomeMethod(){varx=newFoo.Class1;//compileerror!}}}编译错误为:Thetypeornamespacename'Class1'doesnotexistinthenamespace'My.App.Foo'在这种情况下,我似乎无法让VisualStudio识别“Foo.Class1”指的是第一类。如果我将鼠标悬停

c# - 创建参数化线程的问题

我在尝试使用ParameterizedThreadStart创建线程时遇到问题。这是我现在的代码:publicclassMyClass{publicstaticvoidFoo(intx){ParameterizedThreadStartp=newParameterizedThreadStart(Bar);//nooverloadforBarmatchesdelegateParameterizedThreadStartThreadmyThread=newThread(p);myThread.Start(x);}privatestaticvoidBar(intx){//dowork}}我不

c# - "value cannot be null parameter name: key"

我在调试我正在处理的网站时遇到“蓝屏死机”。错误信息是“valuecannotbenull.Parametername:key.”我正在尝试将formview绑定(bind)到gridview的选定索引。当我在我的selectedindexchanged方法中设置断点时,一切似乎都正确绑定(bind),我可以查看我的formview的值,但是当我继续运行它时,我收到上述错误消息。我尝试将datakeynames属性添加到formview并得到相同的错误消息。我在这里和谷歌搜索并看到了一些结果,但似乎没有一个能解决或与我的问题相关。部分代码如下:protectedvoidGridView